import request from '@/config/axios'

// 物资盘点 VO
export interface AssetsCheckVO {
  id: number // 编号
  categoryId: number // 分类ID
  assetType: number // 物资类型
  assetId: number // 物资ID
  assetCode: string // 物资编号
  assetName: string // 物资名称
  stockQuantity: number // 库存数量
  actualQuantity: number // 实际数量
  difference: number // 差额
  adjustmentStatus: number // 库存调整状态
  adjustmentType: number // 调整类型
  price: number // 价格
  status: number // 状态
  remark: string // 备注
}

// 物资盘点 API
export const AssetsCheckApi = {
  // 查询物资盘点分页
  getAssetsCheckPage: async (params: any) => {
    return await request.get({ url: `/school/assets-check/page`, params })
  },

  // 查询物资盘点详情
  getAssetsCheck: async (id: number) => {
    return await request.get({ url: `/school/assets-check/get?id=` + id })
  },

  // 新增物资盘点
  createAssetsCheck: async (data: AssetsCheckVO) => {
    return await request.post({ url: `/school/assets-check/create`, data })
  },

  // 修改物资盘点
  updateAssetsCheck: async (data: AssetsCheckVO) => {
    return await request.put({ url: `/school/assets-check/update`, data })
  },

  // 删除物资盘点
  deleteAssetsCheck: async (id: number) => {
    return await request.delete({ url: `/school/assets-check/delete?id=` + id })
  },

  // 导出物资盘点 Excel
  exportAssetsCheck: async (params) => {
    return await request.download({ url: `/school/assets-check/export-excel`, params })
  },
}